{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c3e49026-e6e4-4757-8b89-1ff473cbe5da",
   "metadata": {},
   "source": [
    "# 环境\n",
    "在shell中运行下面的命令，使用python3.12版本，并安装相关依赖。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "46fc3274-08ad-47c0-a9f8-50db88c7697e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "CondaError: Run 'conda init' before 'conda activate'\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 创建python 3.12版本环境\n",
    "conda create --name p312 python=3.12 \n",
    "# 激活环境\n",
    "conda activate p312\n",
    "# 验证\n",
    "python --version"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3f35fb1f-76f9-4c43-b0ad-19c0456d4006",
   "metadata": {},
   "outputs": [],
   "source": [
    "# langchain LangChain：专注于自然语言处理（NLP）任务的库，提供了一系列工具和组件，用于处理和分割文本、生成嵌入向量、构建语言模型等。\n",
    "# langchain_community 提供一系列工具和组件，如对于原生文件的加载器，如PyPDFLoader用于PDF文档提取\n",
    "# pypdf 是一个纯Python的库，用于读取、操作和写入PDF文件。\n",
    "# sentence-transformers 将文本转换成固定长度的向量表示，可以加载相关的模型，如bge-small-zh-v1.5\n",
    "# faiss-cpu Facebook开源的向量相似度搜索库的CPU版本\n",
    "# dashscope 阿里云提供的一个Python SDK，用于调用阿里云的各种AI服务，包括自然语言处理、计算机视觉、语音识别等。\n",
    "pip install langchain langchain_community pypdf sentence-transformers faiss-cpu dashscope"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
